package test;

/**
 * Created by key on 2015/2/13.
 */
public class Thread01 {
    public static void main(String[] args){
        ThreadInterrupt ti  = new ThreadInterrupt();
        Thread t1 = new Thread(ti,"t1");
        Thread t2 = new Thread(ti,"t2");
        Thread t3 = new Thread(ti,"t3");
        t1.start();
        t2.start();
        t3.start();


//        //测试线程中断
//        ThreadInterrupt ti = new ThreadInterrupt();
//        Thread t = new Thread(ti);
//        t.start();
//        try{
//            Thread.sleep(1000);
//        }catch (InterruptedException e){
//            System.out.println("主线程中断");
//        }
//        t.interrupt();


        //测试线程命名  2015-02-15
        //        Demo d = new Demo();
//        //Demo02 d2 = new Demo02();
//        Thread t1 = new Thread(d,"一号");
//        Thread t2 = new Thread(d,"二号");
//        t1.start();
//        t2.start();
    }
}
